//
//  ST_PairsCenterPropsGuideView.swift
//  btvideo
//
//  Created by mac on 2020/10/19.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwiftyAttributes

class ST_PairsCenterPropsGuideView: UIView {

    
//    23+63
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(imageView)
        self.addSubview(content_label)
        self.addSubview(top_image_view)
        imageView.snp.makeConstraints { (make) in
            make.bottom.left.right.equalToSuperview()
            make.height.equalTo(63)
        }
        
        top_image_view.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.width.height.equalTo(44)
            make.top.equalToSuperview()
        }
        
        
        content_label.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.bottom.equalToSuperview().offset(-10)
        }
        
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - Properties
    fileprivate lazy var imageView:UIImageView = {
        let control = UIImageView.init(image: ST_ImageUtils.imageName("PairsCenterPropsGuideView_background"))
              control.contentMode = .scaleAspectFill
              return control
          }()
    
    fileprivate lazy var top_image_view:UIImageView = {
        let control = UIImageView.init(image: ST_ImageUtils.imageName("PairsCenterPropsGuideView_top"))
              control.contentMode = .scaleAspectFill
              return control
          }()
    
    fileprivate lazy var content_label:UILabel = {
        
        let control = UILabel.init()
        
        let p =  NSParagraphStyle.create_line_spacing_paragraph_style(lineSpacing: 2)
        
        p.alignment = .center
        let str = "长按使用心动礼物\n100%成功".withAttributes([Attribute.textColor(UIColor.white),Attribute.paragraphStyle(p),Attribute.font(UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.medium))])
        
        control.numberOfLines = 0
        
        control.attributedText = str
        
        return control
    }()
    
}
